package root.electronclass.electronclass.grade.excellent_students

import android.os.Bundle
import android.view.View
import root.electronclass.electronclass.common.base.ViewBindingFragment
import root.electronclass.electronclass.R
import root.electronclass.electronclass.databinding.FragmentClassExcellentStudentsDetailBinding
import root.electronclass.electronclass.grade.model.Person
import root.electronclass.electronclass.ext.*

/**
 * 班级优秀生
 * @author Lokiy
 * @date 2023/2/5 13:19
 */
class ClassExcellentStudentsDetailFragment : ViewBindingFragment<FragmentClassExcellentStudentsDetailBinding>() {

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        val item: Person = arguments?.getParcelable("_DATA") ?: return
        binding.itemName.text = item.name
        binding.itemNo.text = getString(R.string.class_student_no, item.no)
        binding.itemFav.text = item.fav
        binding.itemSpecialty.text = item.specialty
        binding.itemSlogan.text = item.slogan
        binding.itemStory.text = item.story
        binding.itemEvaluation.text = item.evaluation
        binding.itemAvatar.showAvatar(item.avatar, if (item.gender == 1) 3 else 2)
    }
}
